Javascript PropertiesonKeyDown Event
Arguments
- eventEvent
An object that contains properties and methods for inspecting and manipulating the browser event. This object can be referenced in JavaScript added to the event, either through Action Javascript or using Text Mode.
See Event (MDN Web Docs) for more details.
Description
Fires when the user presses a key down on the keyboard while the control has focus.
Discussion
The onKeyDown event fires when the user presses down a key on the keyboard when a control has focus. It is the first keyboard event to fire when the user presses a key. This event can be used to execute an Action Javascript, custom JavaScript, or server-side Xbasic to perform an action. For example, when filling out a text control, you may want to automatically save the Grid row when the user presses the Enter key:
// Submit the Grid Row if the Enter Key has been pressed
if (event.keyCode == 13) {
// Enter key has been pressed
// Simulate clicking the SAVE button for the row:
{grid.object}.submitGridPartRow({grid.rownumber});
}For more information about keyboard events, see Mozilla's documentation on KeyboardEvents or the developer documentation for your favorite web browser.